home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / packages.scm < prev    next >
Text File  |  1995-10-13  |  9KB  |  358 lines

  1. ; Copyright (c) 1993, 1994 Richard Kelsey and Jonathan Rees.  See file COPYING.
  2.  
  3. ; Meta-modules: the big picture.
  4.  
  5.  
  6. ; Various implementations of Primitive Scheme.
  7.  
  8. (define-structure low-structures low-structures-interface
  9.   (open meta-module-system the-interfaces)
  10.   (files low-packages))
  11.  
  12. (define-structure debug-low-structures low-structures-interface
  13.   (open meta-module-system the-interfaces
  14.     ;; built-in-structures
  15.     )
  16.   (files (alt low-packages)))
  17.  
  18.  
  19. ; Usual Scheme 48 run-time system.
  20.  
  21. (define (make-run-time low-structures)
  22.   (structures (run-time-structures-interface
  23.            run-time-internals-structures-interface
  24.            features-structures-interface)
  25.     (open meta-module-system the-interfaces
  26.       low-structures)
  27.     (files rts-packages)))
  28.  
  29.  
  30. ; Alternatives to the usual Scheme 48 run-time system.
  31.  
  32. (define-structure alt-features-structures features-structures-interface
  33.   (open meta-module-system the-interfaces)
  34.   (files (alt features-packages)))
  35.  
  36. (define-structure cheat-features-structures features-structures-interface
  37.   (open meta-module-system the-interfaces)
  38.   (begin (define-structures ((signals signals-interface)
  39.                  (handle handle-interface)
  40.                  (features features-interface)
  41.                  (records records-interface)
  42.                  (ascii ascii-interface)
  43.                  (bitwise bitwise-interface)
  44.                  (code-vectors code-vectors-interface))
  45.        ;; Assumes use of FLATLOAD.  The implementations of these
  46.        ;; structures will become available via some miracle, e.g.
  47.        ;; a command ",open signals ... code-vectors" or an
  48.        ;; explicit LOAD of something.  Cf. the rule for
  49.        ;; link/linker.image in the Makefile.
  50.        )))
  51.  
  52. (define-module (make-alt-run-time features-structures)
  53.   (structures (low-structures-interface
  54.            run-time-structures-interface)
  55.     (open meta-module-system the-interfaces
  56.       features-structures)
  57.     (files alt-packages
  58.        (alt low-packages))))
  59.  
  60.  
  61. ; Byte-code compiler and related things.
  62.  
  63. (define-module (make-compiler-structures run-time-structures
  64.                      features-structures)
  65.  
  66.   (define-structure compiler-structures compiler-structures-interface
  67.     (open meta-module-system the-interfaces
  68.       run-time-structures
  69.       features-structures)
  70.     (files comp-packages))
  71.  
  72.   compiler-structures)
  73.  
  74.  
  75. ; The initial system (initial.image).  Cf. the rule for initial.image
  76. ; in the Makefile.
  77.  
  78. (define (make-initial-structures low-structures
  79.                  run-time-structures
  80.                  run-time-internals-structures
  81.                  features-structures
  82.                  compiler-structures)
  83.   (structure initial-structures-interface
  84.     (open meta-module-system the-interfaces
  85.       low-structures        ;Cf. desirable-structures
  86.       run-time-structures
  87.       features-structures
  88.       run-time-internals-structures
  89.       compiler-structures)
  90.     (files initial-packages)))
  91.  
  92.  
  93. ; Small systems.
  94.  
  95. (define-structure (make-debug-structures low-structures
  96.                      run-time-structures
  97.                      run-time-internals-structures
  98.                      features-structures
  99.                      initial-structures)
  100.   (structure debug-structures-interface
  101.     (open meta-module-system the-interfaces
  102.       low-structures
  103.       run-time-structures
  104.       run-time-internals-structures
  105.       features-structures
  106.       initial-structures)
  107.     (files debug-packages)))
  108.  
  109.  
  110. ; Static linker.
  111.  
  112. (define-module (make-linker-structures features-structures
  113.                        run-time-structures
  114.                        compiler-structures)
  115.  
  116.   (define-structure linker-structures linker-structures-interface
  117.     (open meta-module-system the-interfaces
  118.       features-structures
  119.       run-time-structures
  120.       compiler-structures)
  121.     (files link-packages))
  122.  
  123.   linker-structures)
  124.  
  125.  
  126.  
  127. ; The following definition of THE-INTERFACES assumes that we're
  128. ; "flatloading."  If we were really using the module system, then its
  129. ; interface would have to include all of the interfaces defined in
  130. ; interfaces.scm, and it would need a (files interfaces) clause.
  131.  
  132. (define-structure the-interfaces the-interfaces-interface
  133.   (open )
  134.   ;; (files interfaces)
  135.   )
  136. (define-interface the-interfaces-interface
  137.   (export scheme-level-0-interface
  138.       primitives-interface
  139.       ;; ... etc. etc. ad nauseum
  140.       for-reification-interface))
  141.  
  142. ; This definition of META-MODULE-SYSTEM assumes that we're flatloading.
  143. ; If we weren't, it would have to be
  144. ;   (def meta-module-system module-system)
  145. ; instead.
  146.  
  147. (define-structure meta-module-system (export ) (open ))  ;Kludge
  148.  
  149.  
  150.  
  151. ; --------------------
  152. ; Particular assemblies:
  153.  
  154. ; The usual run-time system (for initial.image, etc.).
  155.  
  156. (def run-time-structures run-time-internals-structures features-structures
  157.   (make-run-time low-structures))
  158.  
  159.  
  160. ; The byte-code compiler as constituted for initial.image and friends.
  161.  
  162. (def compiler-structures
  163.   (make-compiler-structures run-time-structures
  164.                 features-structures))
  165.  
  166.  
  167. ; The initial system made in the usual way.
  168.  
  169. (def initial-structures
  170.   (make-initial-structures low-structures
  171.                run-time-structures
  172.                run-time-internals-structures
  173.                features-structures
  174.                compiler-structures))
  175.  
  176.  
  177. ; Debug systems.
  178.  
  179. (def debug-structures
  180.   (make-debug-structures low-structures
  181.              run-time-structures
  182.              run-time-internals-structures
  183.              features-structures
  184.              initial-structures))
  185.  
  186.  
  187. ; The usual development environment (scheme48.image).
  188.  
  189. (define-structure usual-structures (export (usual-features :structure))
  190.   (open meta-module-system
  191.     run-time-structures
  192.     compiler-structures
  193.     initial-structures
  194.     (make-linker-structures features-structures
  195.                 run-time-structures
  196.                 compiler-structures))
  197.   (files ;; more-interfaces, when not flatloading
  198.      more-packages))
  199.  
  200.  
  201. ; The linker running in a random Scheme system (Lucid, Scheme->C, or
  202. ; old version of Scheme 48).  If running in Scheme 48, this becomes
  203. ; link/linker.image.
  204.  
  205. (def alt-low-structures alt-run-time-structures
  206.   (make-alt-run-time cheat-features-structures))
  207.  
  208. (def linker-structures
  209.   (make-linker-structures cheat-features-structures
  210.               alt-run-time-structures
  211.               (make-compiler-structures cheat-features-structures
  212.                             alt-run-time-structures)))
  213.  
  214.  
  215.  
  216. ; --------------------
  217. ; Meta-interfaces.
  218. ; These are ignored by FLATLOAD, but DESIRABLE-STRUCTURES (in
  219. ; initial.scm) extracts the list of srtuctures to be reified from
  220. ; them.
  221.  
  222. (define-interface low-structures-interface
  223.   (export ((ascii
  224.         bitwise
  225.         closures
  226.         code-vectors
  227.         escapes
  228.         features
  229.         locations
  230.         loopholes
  231.         low-level
  232.         primitives
  233.         scheme-level-0
  234.         signals
  235.         silly
  236.         source-file-names
  237.         structure-refs
  238.         vm-exposure
  239.         write-images)
  240.        :structure)))
  241.  
  242. ; Of the feature-structures, only handle and records aren't also
  243. ; low-structures.
  244.  
  245. (define-interface features-structures-interface
  246.   (export ((ascii
  247.         bitwise
  248.         code-vectors
  249.         features
  250.         handle
  251.         records
  252.         signals)
  253.        :structure)))
  254.  
  255. (define-interface run-time-structures-interface
  256.   (export ((architecture
  257.         bummed-define-record-types
  258.         ;; closures
  259.         enumerated
  260.         fluids
  261.         ;; locations
  262.         ;; loopholes
  263.         ;; source-file-names
  264.         scheme-level-1
  265.         scheme-level-2
  266.         templates
  267.         util
  268.         weak
  269.         ;; write-images
  270.         )
  271.        :structure)))
  272.  
  273. (define-interface run-time-internals-structures-interface
  274.   (export ((conditions
  275.         continuations
  276.         display-conditions
  277.         ;; escapes
  278.         exceptions
  279.         fluids-internal
  280.         methods
  281.         meta-methods
  282.         interrupts
  283.         low-level
  284.         more-types
  285.         number-i/o
  286.         ports
  287.         ;; primitives
  288.         reading
  289.         records-internal
  290.         scheme-level-2-internal
  291.         ;; silly
  292.         ;; structure-refs
  293.         ;; vm-exposure
  294.         wind
  295.         writing)
  296.        :structure)))
  297.   
  298. (define-interface compiler-structures-interface
  299.   (export ((compiler
  300.         debug-data
  301.         defpackage
  302.         filenames
  303.         inline
  304.         meta-types
  305.         interfaces
  306.         module-system
  307.         packages
  308.         packages-internal
  309.         reconstruction
  310.         scan
  311.         segments
  312.         syntactic
  313.         tables
  314.         types
  315.         usual-macros)
  316.        :structure)))
  317.  
  318. (define-interface initial-structures-interface
  319.   (export ((environments
  320.         evaluation
  321.         ensures-loaded
  322.         ;; for-reification is in there, but shouldn't get reified.
  323.         )
  324.        :structure)
  325.       ((make-scheme
  326.         make-mini-command
  327.         make-initial-system)
  328.        :procedure)))
  329.  
  330.  
  331. ; Initial + usual (scheme48.image).
  332.  
  333. (define-interface linker-structures-interface
  334.   (export ((analysis
  335.         debuginfo
  336.         expander
  337.         flatloading
  338.         linker
  339.         link-config
  340.         loadc
  341.         reification)
  342.        :structure)))
  343.  
  344. (define debug-structures-interface
  345.   (export ((mini-eval
  346.         mini-environments
  347.         mini-scheme
  348.         little-system
  349.         mini-for-reification
  350.         mini-packages
  351.         mini-system
  352.         run
  353.         medium-scheme
  354.         medium-system)
  355.        :structure)
  356.       mini-eval
  357.       mini-environments))
  358.